package cn.amossun.starter.web.data.security.entity;

import cn.hutool.core.util.StrUtil;
import cn.amossun.starter.web.data.security.util.AuthUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @program: starter-parent
 * @description:
 * @author: Amos.Sun
 * @DateTime: 2020/03/14 12:27
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Query {

    private Integer current = 1;

    private Integer size = 15;

    private String serviceName;

    private String version;

    private String userId;


    public String getUserId() {
        String userId = AuthUtil.getUserId();
        if(StrUtil.isNotEmpty(userId)) {
            return userId;
        }
        return this.userId;
    }

}
